package com.sjz.myfrist;

import okhttp3.OkHttpClient;
import okhttp3.Request;

/****
 *    封装的工具类
 *    sendOkHttpRequest()方法中有一个okHttp3.Callback参数，这是OkHttp库中自带的一个回调接口，最终结果会回调到okhttp3.Callback中。
 */
public class HttpUtil {
    public static void sendOkHttpRequest(final String address, final okhttp3.Callback callback) {
        OkHttpClient client = new OkHttpClient();
        Request request = new Request.Builder()
                .url(address)
                .build();
        client.newCall(request).enqueue(callback);
    }
}
